package com.core.framework.tools;
/**
 * String帮助类
 * @author 刘涛
 * @since Jun 27, 2012
 */
public class StringUtils extends org.apache.commons.lang3.StringUtils{
	public StringUtils() {
		
	}

	public static String capitalize(String str) {
		
		return changeFirstCharacterCase(str, true);
	}

	private static String changeFirstCharacterCase(String str,
			boolean capitalize) {
		if (str == null || str.length() == 0)
			return str;
		StringBuilder sb = new StringBuilder(str.length());
		if (capitalize)
			sb.append(Character.toUpperCase(str.charAt(0)));
		else
			sb.append(Character.toLowerCase(str.charAt(0)));
		sb.append(str.substring(1));
		return sb.toString();
	}

}
